package com.dfk.bs.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dfk.bs.entity.Housetype;
import com.dfk.bs.entity.User;
import com.dfk.bs.dao.UserMapper;
import com.dfk.bs.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * <p>
 * 用户信息表 服务实现类
 * </p>
 *
 * @author DDK
 * @since 2019-12-12
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public void pageQuery(Page<User> pageParam, String selectname) {
        QueryWrapper<User> queryWrapper=new QueryWrapper<>();

        /*查询出来排序 根据表中的sort字段排序*/
        queryWrapper.orderByAsc("sort");
        if (selectname==null){
            baseMapper.selectPage(pageParam,queryWrapper);
            return;
        }

        queryWrapper.like("name", selectname);

        baseMapper.selectPage(pageParam,queryWrapper);
    }
}
